<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>后台管理</title>

    <script src="__STATIC__/jquery-2.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <link rel="stylesheet" href="__STATIC__/layui/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">

    {include file="public/header" /}
    {include file="public/left" /}
    <style>
        .layui-table-cell{
            height: 33px;
        }
    </style>



    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">


            <fieldset class="layui-elem-field layui-field-title"  style="margin-top: 50px;">
                <legend>导出列表</legend>
            </fieldset>


            <table class="layui-hide" id="list"></table>



            <script>

                // 实现方法
                // @param name { String } 需要返回的属性名
                // @param arr { Array } 原始数据
                // @return ret { Array } 返回值
                function getParamValues(name, arr) {
                    var ret = []
                    for (var i = 0, len = arr.length; i < len; i++) {
                        ret.push(arr[i][name])
                    }
                    return ret
                }

                layui.use(['table','layer'], function(){
                    var table = layui.table;

                    table.render({
                        elem: '#list'
						,limits: [10,20,30,40,50,60,70,80,90,100,150,200]
                        ,url: "{:url('Data/listjson')}"
                        ,cols: [[
                            {type:'checkbox',width:'3%'}
                            ,{field:'id', width:'10%', title: 'ID', sort: true}
                            ,{field:'filename', width:'15%', title: '文件名'}
                            ,{field:'status', width:'15%', title: '状态',sort: true}
                            ,{field:'create_time', width:'15%', title: '创建时间'}
                            ,{field:'operation', minWidth: '200', title: '操作',templet: '#operation'}
                        ]]
                        ,page: true,
                        id:'tb'
                    });






                });
            </script>
            <script type="text/html" id="operation">

                <a class="layui-btn layui-btn-normal" href="{literal}{{d.filepath}} {/literal}" >下载</a>
                <a class="layui-btn layui-btn-danger delbtn"  onclick=" return confirm('你真的要删除这个文件吗')" href="{:url('Data/delete' )}?{literal}uid={{d.id}}& {/literal}" >删除</a>
            </script>

        </div>
    </div>


</div>

<script>

    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
    $('#logout').click(function (e) {
        e.preventDefault();
        layui.use('layer', function(){
            var layer = layui.layer;

            layer.confirm('你真的要退出吗？',['yes','no'],function () {
                location.href="{:url('login/logout')}";
            },function () {
                
            })
        });
    })

    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#start_date'
            ,max: 0 //7天后
        });
        laydate.render({
            elem: '#end_date'
            ,max: 0 //7天后
        });
    });




</script>

</body>
</html>